<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title>改变盒子大小</title>
		<style>
			* {
				padding: 0;
				margin: 0;
			}
			
			#box {
				width: 100px;
				height: 100px;
				margin-top: 25px;
				margin-left: 25px;
				background-color: yellow;
			}
		</style>
	</head>

	<body>
		<div id="box"></div>
		<script>
			var box = document.getElementById('box');
			var i = 0;
			box.onclick = function() {
				i++;
				if(i % 2 == 0) {
					document.getElementById('box').innerHTML = "小";
					box.style.width = "75px";
					box.style.height = "75px";
				} else {
					document.getElementById('box').innerHTML = "大"
					box.style.width = "200px";
					box.style.height = "200px";
				}
			}
		</script>
	</body>

</html>